﻿Public Class DGvTrans

  
    Private Sub DGvTrx1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DGvTrx1.KeyUp
        Dim ic, ir As Integer
        ic = DGvTrx1.CurrentCell.ColumnIndex
        ir = DGvTrx1.CurrentCell.RowIndex

        If e.KeyValue = 13 Then
            If DGvTrx1.CurrentCell.ColumnIndex = 1 Or DGvTrx1.CurrentCell.ColumnIndex = 2 Then
                DGvTrx1.CurrentCell = DGvTrx1(3, ir)
                DGvTrx1.CurrentCell.Selected = True
            ElseIf DGvTrx1.CurrentCell.ColumnIndex = 4 Or DGvTrx1.CurrentCell.ColumnIndex = 5 Then
                DGvTrx1.CurrentCell = DGvTrx1(0, ir + 1)
                DGvTrx1.CurrentCell.Selected = True
            End If
        End If
    End Sub
End Class
